window.onload = function() {
	var email = document.getElementById('email');
	var word = document.getElementById('word');
	var word_t = document.getElementById('word_t');
	var pass = document.getElementById('pass');
	var pass_t = document.getElementById('pass_t');
	var yana = document.getElementById('yan');

	/* input框光标兼容ie7 */
	if (navigator.userAgent.indexOf("MSIE 7.0") > -1
			|| navigator.userAgent.indexOf("MSIE 8.0") > -1) {
		email.style.lineHeight = "30px";
		word.style.lineHeight = "30px";
		word_t.style.lineHeight = "30px";
		pass.style.lineHeight = "30px";
		pass_t.style.lineHeight = "30px";
		yana.style.lineHeight = "30px";

	}
	/*-----------email------------*/
	email.onfocus = function() {
		changeOption(this, "用于登录及找回密码使用", "", "#000");
	}
	email.onblur = function() {
		if(!"用于登录及找回密码使用"!==email.value){
			$("#prompt1").hide();
		}
		changeOption(this, "", "用于登录及找回密码使用", "#ccc");
	}
	/*----------------密码---------------------*/

	word.onfocus = function() {
		word.style.display = "none";
		word_t.style.display = "inline-block";
		word_t.value = "";
		word_t.style.color = "#000";
		word_t.focus();

	}
	word_t.onblur = function() {
		if(!isEmpty(word_t.value)){
			$("#prompt2").hide();
		}
		if (this.value == "") {
			word.style.display = "inline-block";
			word_t.style.display = "none";
			word.value = "6-16位数字或密码，区分大小写";
			word.style.color = "#ccc";
		}
	}

	pass.onfocus = function() {
		pass.style.display = "none";
		pass_t.style.display = "inline-block";
		pass_t.value = "";
		pass_t.style.color = "#000";
		pass_t.focus();

	}
	pass_t.onblur = function() {
		if(!isEmpty(pass_t.value)){
			$("#prompt3").hide();
		}
		if (this.value == "") {
			pass.style.display = "inline-block";
			pass_t.style.display = "none";
			pass.value = "请确认密码";
			pass.style.color = "#ccc";

		}

	}

	yana.onfocus = function() {
		changeOption(this, "验证码", "", "#000");
	}
	yana.onblur = function() {
		if("验证码"!==yan.value){
			$("#prompt4").hide();
		}
		changeOption(this, "", "验证码", "#ccc");
	}
	function changeOption(obj, valone, valtwo, color) {
		if (obj.value == valone) {
			obj.value = valtwo;
			obj.style.color = color;
		}
	}
}